﻿using System.Collections.Generic;

namespace MathParser.DataModel {

    public enum Operation {
        Sinus,
        Cosinus,
        Tangens,
        Potenz,
        No,
        Plus,
        Minus,
        Multi,
        Divi,
        Variable,
        Zahl,
        Pi,
        E,
        Sqrt,
        Lg,
        Ln,
        Lb,
        Fakultät
    }

    internal class OperationMapper {
        internal readonly Dictionary<string, Operation> BinärMap = new Dictionary<string, Operation>();
        internal readonly Dictionary<string, Operation> UnärMap = new Dictionary<string, Operation>();
        internal readonly Dictionary<string, Operation> ConstMap = new Dictionary<string, Operation>();

        internal OperationMapper() {
            this.ConstMap.Add("x", Operation.Variable);
            this.ConstMap.Add("pi", Operation.Pi);
            this.ConstMap.Add("e", Operation.E);

            this.UnärMap.Add("sin", Operation.Sinus);
            this.UnärMap.Add("cos", Operation.Cosinus);
            this.UnärMap.Add("tan", Operation.Tangens);
            this.UnärMap.Add("sqrt", Operation.Sqrt);
            this.UnärMap.Add("lg", Operation.Lg);
            this.UnärMap.Add("ln", Operation.Ln);
            this.UnärMap.Add("lb", Operation.Lb);
            this.UnärMap.Add("!", Operation.Fakultät);

            this.BinärMap.Add("+", Operation.Plus);
            this.BinärMap.Add("-", Operation.Minus);
            this.BinärMap.Add("*", Operation.Multi);
            this.BinärMap.Add("/", Operation.Divi);
            this.BinärMap.Add("^", Operation.Potenz);
        }
    }
}
